<?php
/*------------------------------------------------------------------------
# company - company management
# @author    pipapai.com
-------------------------------------------------------------------------*/

defined('_JEXEC') or die;
// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if(isDevMode()) {
   OCP\Util::addStyle('company', 'company');
} else {
   OCP\Util::addStyle('static', 'company');
}

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$user = $_['user'];
UserPrivacy::getUserPrivacySettings($user, 'com_company');
$me = PFactory::getUser();
?>

<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('company/js', 'company.php'));?>"></script>

<div class="row-fluid">
   <div class="span12">
      <div class="com_box com_box_top">
         <div class="clearfix">
            <div class="company_infomodel pull-left">
               <div class="view_companymessage medium clearfix"><img src="<? echo PCompanyHelper::showCompanyAvatar($user->avatar, $user->avatarapproved);?>"/><br/><span>最后登录时间<br/><? echo JobHelper::getUserLastLogonDate($user);?></span></div>
            </div>
            
            <div style=" margin-left:160px;">
               <div class="company_showinfo">
                  <h4 class="yahei"><?=$user->comp_name?><i class="<? echo $user->validated == EMPLOYER_VALIDATED ? "is_approve" : "not_approve";?>"></i></h4>
               </div>
      
               <div class="company_viewcombox">
                  <h6 class="yahei large">公司信息</h6>
                  <div class="company_viewbasic">
                     <table class="medium clearfix" width="100%" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                           <td>公司行业：<?=$user->industry ? JText::_($user->industry) : '暂无'?></td>
                           <td>公司性质：<?=$user->comp_type ? JText::_($user->comp_type) : '暂无'?></td>
                        </tr>
                        <tr>
                           <td>所在地区：<?php echo ($user->state || $user->city) ? ($user->state == $user->city ? $user->state : $user->state.' '.$user->city) : ''; ?></td>
                           <td>公司规模：<?=$user->size_type ? $user->size_type : '暂无'?></td>
                        </tr>
                        <tr>
                        <?php
                           $fieldname = "contactname";
                           $privacy = UserPrivacy::checkFieldPrivacy($user, $me, $fieldname);
                           if($privacy){
                              $privacy_value=UserPrivacy::getUserPrivacyFieldSetting($user,$fieldname);
                              if($privacy_value->privacy==USER_PRIVACY_PUBLIC){
                        ?>
                           <td>联&nbsp;&nbsp;系&nbsp;&nbsp;人：<?=$user->contact_name ? $user->contact_name : '暂无'?></td>
                        <?php 
                              }
                           }
                        ?>
                        <?php
                           $phonefieldname = "telephone";
                           $phoneprivacy = UserPrivacy::checkFieldPrivacy($user, $me, $phonefieldname);
                           if($phoneprivacy){
                              $phoneprivacy_value=UserPrivacy::getUserPrivacyFieldSetting($user,$phonefieldname);
                              if($phoneprivacy_value->privacy==USER_PRIVACY_PUBLIC){
                        ?>
                           <td>联系电话：<?=$user->phone ? $user->phone : '暂无'?></td>
                        <?php 
                              }
                           }
                        ?>
                        </tr>
                        <tr>
                           <td colspan="2">公司地址：<?=$user->address ? $user->address : '暂无'?></td>
                        </tr>
                        <tr>
                           <td colspan="2">公司网址：<?=$user->website ? "<a href='".$user->website."' target='_blank'>".$user->website."</a>" : "暂无"?></td>
                        </tr>
                     </table>
                  </div>
               </div>
            </div>
         </div>

         <div class="company_viewcombox">
            <h6 class="yahei large">公司概况</h6>
            <div class="company_viewsummry medium">
               <?=$user->summary ? $user->summary : '暂无'?>
            </div>
         </div>
      </div>
   </div>
</div>
